// Copyright (C) joyinter
// All rights reserved.
// 
// Author : Jiang Li
// Date   : 2004-7-29

#ifndef __RICHVIEW_H_COMMON_UI__
#define __RICHVIEW_H_COMMON_UI__

#pragma once
#include "wnd.h"
#include <afxrich.h>
#include "scrollbar.h"

class CJoyRichView;

//##ModelId=44C4B602034B
class CJoyRichViewWrapper : public CRichEditView
{
public:
	//##ModelId=44C4B602034D
    bool Create(CJoyRichView* parent);

	//##ModelId=44C4B602035C
    CJoyRichView* m_owner;
public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B6020360
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B602036B
    afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	//##ModelId=44C4B6020370
    afx_msg void OnSize(UINT nType, int cx, int cy);
protected:
	//##ModelId=44C4B602037B
    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
public:
	//##ModelId=44C4B602037E
    afx_msg void OnEnVscroll();
};

//##ModelId=44C4B602038A
class CJoyRichView :
    public CJoyWnd
{
public:
	//##ModelId=44C4B602039A
    CJoyRichViewWrapper* m_rv;
	//##ModelId=44C4B602039F
    CJoyScrollBar*  m_vScroll;
public:
	//##ModelId=44C4B60203A9
    CJoyRichView(void);
	//##ModelId=44C4B60203AB
    virtual ~CJoyRichView(void);

	//##ModelId=44C4B60203AE
    virtual bool Create(CWnd* parent, const CRect& area);
	//##ModelId=44C4B60203B9
    void ApplyScroll();
	//##ModelId=44C4B60203BA
    void ClearText();
	//##ModelId=44C4B60203BB
    float GetRVScrollPos();

	//##ModelId=44C4B60203BC
    void CM_VScroll(CJoyScrollBar*, CJoyScrollBar::SCROLLBAR_MESSAGE, float&);

public:
    DECLARE_MESSAGE_MAP()
	//##ModelId=44C4B60203C9
    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	//##ModelId=44C4B60203CC
    afx_msg void OnSize(UINT nType, int cx, int cy);
};

#endif  // __RICHVIEW_H_COMMON_UI__
